// src/pages/ProjectDetail/index.jsx
import React from 'react';
import { useParams } from 'react-router-dom';
import VersionTimeline from '../../components/VersionTimeline';
import styles from './styles.module.css';
import { projects } from '../../data/projects'; // 添加导入语句


export default function ProjectDetail() {
  const { projectId } = useParams();
  const project = projects.find(p => p.id === parseInt(projectId));
  if (!project) return <div className="error">项目不存在</div>;
  return (
    <div className={styles.detailContainer}>
      <section className={styles.detailSection}>
        <h2 className={styles.sectionTitle}>版本历史</h2>
        <VersionTimeline versions={project.versions} />
      </section>
    </div>
  );
}